package dst.graph.explorer;

import dst.graph.GraphSearchable;

/**
 *
 * @param <T> 
 * @author Shimu
 */
public interface TreeExplorer<T> {

    /**
     * Explore the given GraphNode<T>, this function is called in
     * dfs (depth-first search) and bfs (breadth-first search). Returns true
     * if the search should end, false if the search should continue
     * (i.e. this boolean is checked as an exit condition). Each node
     * visited by the tree traversal will be passed to this TreeExplorer 
     * in the order that they were visited. Example, for breadth-first search
     * all the parents would be passed to this method before any of the 
     * children.
     * 
     * @param node the current node to be explored.
     * @return true if the search should stop, false if the search should
     * continue.
     */
    public boolean exploreCurrent(GraphSearchable<T> node);

}
